﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

using FluentValidation;
using CashFlow.ShopManage.Models;

namespace CashFlow.ShopManage.Validator
{
    public class UserIdModelValidator : AbstractValidator<UserIdModel>
    {
        public UserIdModelValidator()
        {
            CascadeMode = CascadeMode.Stop;
            RuleFor(x => x.UserId).Must(x => ValidatorTool.IsUserBelongsMyShop(x))
                .WithMessage("非法UserId");
        }
    }
}